﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics; 
//using System.Runtime.InteropServices;
using System.Timers;
using Timer = System.Timers.Timer;
using System.Collections;
//using System.Threading;
//using System.Windows.Automation;
using System.IO;
//using System.DirectoryServices.AccountManagement;


namespace RejectRDP
{
    public partial class Form1 : Form
    {


        public Form1()
        {
            InitializeComponent();
        }


        Timer intervalTimer = new System.Timers.Timer();
        RDP rdp = new RDP();



        private void Form1_Load(object sender, EventArgs e)
        {
            //intervalTimer.Interval = 15000;
            //intervalTimer.Start();
            //intervalTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
        }

        // Elapsed event is raised.
        private void OnTimedEvent(object source, ElapsedEventArgs e)
        {
            rdp.Init();
        }


        private void button1_Click(object sender, EventArgs e)
        {
            rdp.Init();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            rdp.writeLogFile(@"
dianneman\dian wants to connect to this machine.
Click OK to disconnect your session immediately or click cancel to stay connected.
Otherwise, you will be disconnected in 30 seconds.");
   

        }


    }
}
